<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.prime.com.tr/ui">

    <body>
   <ui:composition template="./../../Template/generalTemplate.xhtml">
            <ui:define name="content">
                <f:view contentType="text/html">
                <h:form id="form" prependId="false">
                    <p:dataTable  selection="#{confirmLineItemReceivedManagedBean.selectedLineItems}" paginator="true" rows="10"  id="table" var="poLineItem"  widgetVar="carsTable" value="#{confirmLineItemReceivedManagedBean.getAllPOLineItems()}" emptyMessage="No records found with given criteria" >  

                        <f:facet name="header">  
                            <p:outputPanel>  
                                <h:outputText value="Search all fields:" />  
                                <p:inputText id="globalFilter" onkeyup="carsTable.filter()" style="width:150px" />  
                            </p:outputPanel>  
                        </f:facet>  
                        <p:column selectionMode="multiple" /> 
                        <p:column filterBy="#{poLineItem.id}"   
                                  headerText="Purchase Order Line Item Id" footerText="contains"  
                                  filterMatchMode="contains"  >  
                            <h:outputText value="#{poLineItem.id}" />  
                        </p:column>  

                          <p:column   filterBy="#{poLineItem.rawMaterial.rawMaterialName}"   
                                   headerText="Raw Material" footerText="contains"  filterMatchMode="contains">  
                          <h:outputText value="#{poLineItem.rawMaterial.rawMaterialName}" />
                       </p:column>  

                        <p:column    filterBy="#{poLineItem.lotQuantity}"  
                                  headerText="Lot Quantity" footerText="startsWith" filterMatchMode="startsWith">  
                            <h:outputText value="#{poLineItem.lotQuantity}" />  
                        </p:column>  
                        
                        <p:column   filterBy="#{poLineItem.totalQuantity}"  
                                  headerText="Purchased Quantity" footerText="startsWith" filterMatchMode="startsWith">  
                            <h:outputText value="#{poLineItem.totalQuantity}" />  
                        </p:column> 
                        
                        <p:column   filterBy="#{poLineItem.cumAmount}"  
                                  headerText="Sub Total Price" footerText="startsWith" filterMatchMode="startsWith">  
                            <h:outputText value="#{poLineItem.cumAmount}" />  
                        </p:column> 
                        
                        <p:column   filterBy="#{poLineItem.supplierLineItemEntity.supplier.supplierName}"  
                                  headerText="Supplier" footerText="contains" filterMatchMode="contains">  
                            <h:outputText value="#{poLineItem.supplierLineItemEntity.supplier.supplierName}" />  
                        </p:column>  

                        <p:column   filterBy="#{poLineItem.received}"  
                                  headerText="Reserved or not" footerText="exact" filterMatchMode="exact">  
                            <h:outputText value="#{poLineItem.received}" />  

                        </p:column>  
                       
                            
                            
                    </p:dataTable> 
                    
                    <p:commandButton actionListener ="#{confirmLineItemReceivedManagedBean.updateReceivedStatus}"  value="update" ajax="false" update="form"  /> 
                                              
                    
                </h:form>
                </f:view>
            </ui:define>
        </ui:composition>



    </body>
</html>
